fix(设备网关): 补齐上行监控包装器委托 - #790
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
目的
CompositeDeviceGatewayMonitor和LazyDeviceGatewayMonitor未完整委托handleUpstream,导致自定义上行监控逻辑被绕过的问题。核心变动
gateway-component的 Composite/Lazy monitor,以及对应单元测试和 TCP 集成回归测试。handleUpstream;Lazy 直接委托真实 target。platformHandler仅在链尾组合一次;保留beforeSendToPlatform注册顺序;空 Composite 仍正常执行平台处理。e485401e21fa0e9a03a7536e08ec055b1ad97cb9。设计与测试目标
DeviceGatewayMonitorSPI 契约和2.12语义未变化。@since 2.12和关联类型说明,Composite 的非显式链式顺序已补代码注释。handleUpstream;修复未增加场景特调。已验证 Composite 原场景、Lazy 同类场景、空 Composite 边界及 TCP 回归。测试结果
cd jetlinks-components/gateway-component && mvn -Dtest=DeviceGatewayMonitorTest test;mvn -pl jetlinks-components/network-component/tcp-component -am -Dtest=TcpServerDeviceGatewayMonitorTest -Dsurefire.failIfNoSpecifiedTests=false test。4bef75ac47b44e32a1f39756f9d4766bb8e6dd21,提交后源码、测试、依赖和origin/2.12均未变化,复用有效。DeviceGatewayMonitorTest新增 Composite、空 Composite、Lazy 用例;TcpServerDeviceGatewayMonitorTest增加自定义handleUpstream调用次数断言。DeviceGatewayMonitorTest9 个通过,0 失败,0 错误,0 跳过。handleUpstream共调用 2 次。handleUpstream行 6/6、分支 2/2;LazyhandleUpstream行 1/1。文档同步情况
风险与说明
beforeSendToPlatform既有顺序语义。platformHandler。e485401e21fa0e9a03a7536e08ec055b1ad97cb9。